package com.cloud.businesscomment.service.serviceImpl;

import com.cloud.businesscomment.dao.Business_commentsMapper;
import com.cloud.businesscomment.service.BusinesscommentService;
import com.cloud.commonapi.model.Business_comments;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * author : 黄永佳
 * create : 2019/9/30 0030 16:00
 * modified :
 * 功能 :
 **/
@Service
public class BusinesscommentServiceImpl implements BusinesscommentService {
    @Autowired
    Business_commentsMapper business_commentsMapper;

    @Override
    public int addpublisher(Business_comments business_comments) {
        return business_commentsMapper.insert(business_comments);
    }


    @Override
    public int findpublisherId(int orderId) {
      return   business_commentsMapper.selectReceiveId(orderId);
    }

    @Override
    public int findrecipientId(int orderId) {
        return business_commentsMapper.selectPublicherId(orderId);
    }

    @Override
    public List<Business_comments> findById(int id) {
        return business_commentsMapper.selectByOrderId(id);
    }


    @Override
    public boolean already(Business_comments business_comments) {
        if(business_commentsMapper.ifAlready(business_comments)!=null){
            return false;
        }else {
            return true;
        }
    }
}
